package study.day5.t8;

public class Grandpa {
    //吹唐人的老爷爷
    public Animal blowAnimal(String type){
        Animal animal;
        if(type.equals("cat")){
            animal = new Cat();
        }else if(type.equals("dog")){
            animal = new Dog();
        }else{
            animal = new Pig();
        }
        return animal;
    }
}
